package org.example.pingpong.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 *
 * </p>
 *
 * @author HL
 * @since 2025-02-13
 */
@Data
@TableName("event")
public class Event implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer areaId;

    /**
     * 标题
     */
    private String title;

    private Date startTime;

    private Date endTime;

    private Date clearStartTime;

    private Date clearEndTime;

    private Integer maxPlayer;

    private Integer maxView;

    /**
     * 赛场信息
     */
    private String msg;

    /**
     * 图
     */
    private String pic;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Event event = (Event) o;
        return Objects.equals(id, event.id) && Objects.equals(areaId, event.areaId) && Objects.equals(title, event.title) && Objects.equals(startTime, event.startTime) && Objects.equals(endTime, event.endTime) && Objects.equals(clearStartTime, event.clearStartTime) && Objects.equals(clearEndTime, event.clearEndTime) && Objects.equals(maxPlayer, event.maxPlayer) && Objects.equals(maxView, event.maxView) && Objects.equals(msg, event.msg) && Objects.equals(pic, event.pic);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, areaId, title, startTime, endTime, clearStartTime, clearEndTime, maxPlayer, maxView, msg, pic);
    }

    @Override
    public String toString() {
        return "Event{" +
                "id=" + id +
                ", areaId=" + areaId +
                ", title='" + title + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", clearStartTime=" + clearStartTime +
                ", clearEndTime=" + clearEndTime +
                ", maxPlayer=" + maxPlayer +
                ", maxView=" + maxView +
                ", msg='" + msg + '\'' +
                ", pic='" + pic + '\'' +
                '}';
    }
}
